<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>计算圆的周长和面积</title>
</head>
<body>
    <input type="text" placeholder="半径" id="a">
    <input type="text" placeholder="周长" id="b">
    <input type="text" placeholder="面积" id="c">
    <script>
    var p=prompt("请输入半径");
    document.querySelector("#a").value=p;
    p=Number(p);
    console.log(p);
    var q=2*Math.PI*p;
    document.querySelector("#b").value=q;
    console.log(q);
    var s=Math.PI*p*p;
    document.querySelector("#c").value=s;
    console.log(s);
    </script>
</body>
</html>